/**
 * @project_name staff_vehicle
 * @package_name com.ssh.ser.admin
 * @desc TODO
 * @param
 * @author jack
 * @date 2013-4-25
 * @time 下午7:38:30
 */
package com.ssh.ser.admin;

import com.ssh.dao.FcarCardDAOI;
import com.ssh.entity.FcarCard;

/**
 * @author jack
 *
 */
public class FVCardManageSerImpl implements FVCardManageSerI {
	FcarCardDAOI fcarCardDAOI ;

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.FVCardManageSerI#newAddFcarCard(com.ssh.entity.FcarCard)
	 */
	@Override
	public FcarCard newAddFcarCard(FcarCard fcarCard) {
		// TODO Auto-generated method stub
		try{
			fcarCardDAOI.addFcarCard(fcarCard);
		}
		catch(Exception e){
			return null;
		}

		return fcarCard;
	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.FVCardManageSerI#updateFcarCard(com.ssh.entity.FcarCard)
	 */
	@Override
	public FcarCard updateFcarCard(FcarCard fcarCard) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.FVCardManageSerI#viewFcarCard(java.lang.String)
	 */
	@Override
	public FcarCard viewFcarCard(String fcarCardId) {
		// TODO Auto-generated method stub
		try{
			return  fcarCardDAOI.queryById(fcarCardId);
		}
		catch(Exception e){
			return null;
		}
	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.FVCardManageSerI#delCard(java.lang.String)
	 */
	@Override
	public int delCard(String fcarCardId) {
		// TODO Auto-generated method stub
		try{
			fcarCardDAOI.deleteById(fcarCardId);
		}
		catch(Exception e){
			return 0;
		}
		return 1;
	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.admin.FVCardManageSerI#editFcarCard(com.ssh.entity.FcarCard)
	 */
	@Override
	public FcarCard editFcarCard(FcarCard fcarCard) {
		// TODO Auto-generated method stub
		try{
			return fcarCardDAOI.updateByFC(fcarCard);
		}
		catch(Exception e){
			return null;
		}
	}

	/**
	 * @return the fcarCardDAOI
	 */
	public FcarCardDAOI getFcarCardDAOI() {
		return fcarCardDAOI;
	}

	/**
	 * @param fcarCardDAOI the fcarCardDAOI to set
	 */
	public void setFcarCardDAOI(FcarCardDAOI fcarCardDAOI) {
		this.fcarCardDAOI = fcarCardDAOI;
	}

}
